package com.it.test;

import com.it.aop.MathCalculator;
import com.it.aop.MathCalculator1;
import com.it.aop.MathCalculator2;
import com.it.config.MainConfigOfAOP;
import com.it.config.MainConfigOfProfile;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.sql.DataSource;

public class IOCTestOfAOP {


    @Test
    public void test1() {
        AnnotationConfigApplicationContext app = new AnnotationConfigApplicationContext(MainConfigOfAOP.class);

        MathCalculator bean = app.getBean(MathCalculator.class);
        int div = bean.div(1, 1);

        MathCalculator1 bean1 = app.getBean(MathCalculator1.class);
        bean1.add(1,2);
        MathCalculator2 bean2 = app.getBean(MathCalculator2.class);
        bean2.muplti(7,2);

        System.out.println(div);

    }


}
